package com.api.springdemo.service.impl;

import com.api.springdemo.dao.HeroMapper;
import com.api.springdemo.entity.Hero;
import com.api.springdemo.service.HeroService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;

/**
 * (Hero)表服务实现类
 *
 * @author makejava
 * @since 2025-09-19 16:34:56
 */
@Service("heroService")
public class HeroServiceImpl extends ServiceImpl<HeroMapper, Hero> implements HeroService {
    @Resource
    private HeroMapper heroMapper;


    @Override
    public List<Hero> getListByName(String name) {
        return heroMapper.selectList(new LambdaQueryWrapper<Hero>().like(Hero::getName, name));
    }
}
